<{include file="admin:common/header.html"}>
<div class="page-title">
    <table width="100%" align="center" cellpadding="0" cellspacing="0" >
        <tr>
            <td width="30" align="right"><img src="<{$pager.url}>/images/main-h5-ico.gif" alt="" /></td>
            <th><{$MOD.title}></th>
            <td align="right">
                &nbsp;&nbsp;&nbsp;
                <{link ctl="kujiale/work:so" load="mini:搜索内容" width="mini:450" class="button" title="搜索"}>
            </td>

            <td width="15"></td>
        </tr>
    </table>
</div>
<div class="page-data">
    <form id="items-form">
        <table width="100%" border="0" cellspacing="0" class="table-data table">
            <tr>
                <th>ID</th>
                <th>用户ID</th>
                <th>昵称</th>
                <th>作品</th>
                <th>主图</th>
                <th class="w-50">状态</th>
                <th>更新时间</th>
                <th class="w-150">操作</th>
            </tr>
            <{foreach $items as $item}>
            <tr>
                <td><{$item.clouddesignid}></td>
                <td><{$item.uid}></td>
                <td><{$item.user_name}></td>
                <td></td>
                <td><img class="designpic" src="<{$item.mainPic}>" title="图片"></td>
                <td></td>
                <td><{$item.dateline|format:"Y-m-d H:i"}></td>
                <td>
                    <{if $item.recommend_status==0}>
                    <a href="javascript:void(0);" class="pbtn submitdesign">提交推荐</a>
                    <{elseif $item.recommend_status==1}>
                    <span>已推荐</span>
                    <{/if}>
                    <input name="clouddesignid" type="hidden" value="<{$item.clouddesignid}>">
                    <{link ctl="kujiale/work:detail" arg0=$item.designid title="详情" class="button"}>
                </td>
            </tr>
            <{foreachelse}>
            <tr><td colspan="8"><p class="text-align tip-notice">没有数据</p></td></tr>
            <{/foreach}>
        </table>
    </form>
    <div class="page-bar">
        <table>
            <tr>
                <td class="w-100"><label><input type="checkbox" CKA="PRI"/>&nbsp;&nbsp;全选</label></td>
                <td colspan="10" class="left"><{link ctl="diary/diary:delete" type="button" submit="mini:#items-form" confirm="mini:确定要批量删除选中的内容吗?" priv="hide" value="批量删除"}>&nbsp;&nbsp;&nbsp;<{link ctl="diary/diary:doaudit" type="button" submit="mini:#items-form" confirm="mini:确定要批量审核选中的内容吗?" priv="hide" value="批量审核"}></td>
                <td class="page-list"><{$pager.pagebar}></td>
            </tr>
        </table>
    </div>
</div>
<style>
    .designpic{ width: 9rem; height: 3rem; }
    a.submitdesign:hover{text-decoration: none}
</style>
<script type="text/javascript">
    $(function(){
        $(".submitdesign").on('click',function(){
            var parentTr = $(this).parent();
//            alert($(parentTr).find("input").val());
//            return;
            $.ajax({
                url: "?kujiale/work-recommend.html",
                type: "POST",
                dataType: "json",
                async:true,
                data:{
                    clouddesignid:$(parentTr).find("input").val()
                }
            }).success(function(response){
                alert(response.message[0]);
                window.location.href = '?kujiale/work-index.html';
            });
        })
    })
</script>
<{include file="admin:common/footer.html"}>